package com.mstore.service;

import java.util.ArrayList;
import java.util.List;

import com.mstore.dao.BaseActDao;
import com.mstore.pojo.BaseAct;

public class BaseActService {

	private BaseActDao baseactDao;

	public void addBaseAct(BaseAct baseact) {
		baseactDao.save(baseact);
	}

	public void deleteBaseAct(BaseAct baseact) {
		baseactDao.delete(baseact);
	}

	public void updateBaseAct(BaseAct baseact) {
		baseactDao.updateBaseAct(baseact);
	}

	public BaseAct getOneBaseAct(BaseAct baseact) {
		return (BaseAct) baseactDao.getOneBaseact(baseact);
	}

	public void delBaseActByMemId(BaseAct baseact) {
		baseactDao.delBaseActByMemId(baseact);
	}

	public void updateBaseActByScore(BaseAct baseact) {
		baseactDao.updateBaseActByScore(baseact);
	}

	public void updateBaseActByBalance(BaseAct baseact) {
		baseactDao.updateBaseActByBalance(baseact);
	}

	/**
	 * 修改会员金额
	 */
	public void updateBaseActByBalanceByMemberId(BaseAct baseact) {
		baseactDao.updateBaseActByBalanceByMemberId(baseact);
	}

	/**
	 * 查询全部
	 */
	public List<BaseAct> getAllBaseActs() {
		List<BaseAct> acts = new ArrayList<BaseAct>();
		
		List<Object> objects = baseactDao.getAllBaseActs();
		for (Object object : objects) {
			acts.add((BaseAct)object);
		}
		
		return acts;
	}
	
	public BaseActDao getBaseactDao() {
		return baseactDao;
	}

	public void setBaseactDao(BaseActDao baseactDao) {
		this.baseactDao = baseactDao;
	}

}
